﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;
using System.Diagnostics;
using System.IO;
using ConsoleApplication1.YIBIYIMVC;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            MVCBuild();
            return;
        }

        private static void MVCBuild()
        {
            int i = 4;

            string dbConnStr, dbname, tableName, nsString, webNSString;            
            if (i == 1)
            {
                dbConnStr = @"server=rm-m5e4bzt763qbs0o60.mysql.rds.aliyuncs.com; user id=yttscz2017; password=pass@word1; database=ytss; pooling=false;";

                dbname = "ytss";
                tableName = "Physics";
                nsString = "YTSS";
                webNSString = "YTSS.WebApi";
            }
            else if(i ==2)
            {
                dbConnStr = @"server=localhost; user id=root; password=root123; database=LinTuo; pooling=false;";

                dbname = "LinTuo";
                tableName = "DictData";
                nsString = "LinTuo";
                webNSString = "LinTuoAdminApi";
            }else if(i == 3)
            {
                dbConnStr = @"server=rm-m5e4bzt763qbs0o60.mysql.rds.aliyuncs.com; user id=yttscz2017; password=pass@word1; database=rope; pooling=false;";

                dbname = "rope";
                tableName = "DictData";
                nsString = "Rope";
                webNSString = "Rope.WebAdmin";
            }else 
            {
                dbConnStr = @"server=localhost; user id=root; password=root123; database=Math; pooling=false;";

                dbname = "Math";
                tableName = "Sign";
                nsString = "Math";
                webNSString = "Math.AdminApi";
            }

            YIBIYIMVCBuilder mvcBuilder = new YIBIYIMVCBuilder(
                dbConnStr, dbname, Path.Combine(Environment.CurrentDirectory, dbname), tableName
                , nsString, webNSString);
            mvcBuilder.Build();
            Console.WriteLine("over!");
            Console.ReadKey();
        }
    }
}
